home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / DATACH.CST / 00206_Script_chartsSprite < prev    next >
Text File  |  1999-03-07  |  2KB  |  51 lines

  1. property mySpritec, hiliteSpritec, myRectc
  2.  
  3. on new me
  4.   set mySpritec = the spriteNum of me
  5.   set hiliteSpritec = mySpritec -2
  6.   set myRectc = the rect of sprite mySpritec
  7.   
  8.   puppetSprite hiliteSpritec, true
  9.   set the loc of sprite hiliteSpritec = point(-1000, -1000)
  10.   
  11.   sendSprite((mySpritec - 1), #register, me)
  12.   return me
  13. end
  14.  
  15. on checkIfInsidec me
  16.   set myRectc = the rect of sprite mySpritec
  17.   set theMouseLoc = point(the mouseH, the mouseV)
  18.   if inside(theMouseLoc, myRectc) then
  19.     set myMember = the member of sprite mySpritec
  20.     set myTop = the top of sprite mySpritec
  21.     set theH = the left of sprite mySpritec
  22.     
  23.     set adjustedMouseV = (the mouseV - myTop)
  24.     set theLine = locVToLinePos(member myMember, adjustedMouseV)
  25.     set theV = linePosToLocV(member myMember, theLine)
  26.     set the loc of sprite hiliteSpritec = point(theH, (theV+myTop))
  27.     set the width of sprite hiliteSpritec = the width of member myMember
  28.   else
  29.     set the loc of sprite hiliteSpritec = point(-1000, -1000)
  30.   end if
  31.   
  32.   updateStage
  33. end
  34.  
  35. on getPlaneNamec me
  36.   set theMouseLoc = point(the mouseH, the mouseV)
  37.   if inside(theMouseLoc, myRectc) then
  38.     set hiliteV = the top of sprite hiliteSpritec - the top of sprite mySpritec
  39.     set myMember = the member of sprite mySpritec
  40.     set theLine = locVToLinePos(member myMember, hiliteV)
  41.     set theText = the text of member myMember
  42.     set textLine = line theLine of theText
  43.     set the loc of sprite hiliteSpritec = point(-1000,-1000)
  44.   else 
  45.     set textLine = ""
  46.   end if
  47.   
  48.   
  49.   return textLine
  50. end
  51.